// pages/agent/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    info:{},
    wxids:[]
  },
  onShow() {
    this.load();
  },
  async load(){
    let res=await wx.util.post("agent/index");
    this.setData({
      info:res.data
    })
    let ids=await wx.util.post("msg/get_wx_ids",{type:'agent'});
    this.setData({
      wxids:ids.data
    })
  },
  toPage(e){
    let s=e.currentTarget.dataset.url;
    wx.util.showLoading();
    wx.requestSubscribeMessage({
      tmplIds: this.data.wxids,
      complete(res){
        wx.hideLoading();
        wx.navigateTo({
          url:s
        })
      }
    })
  }
})